#ifndef _GrayView_H_
#define _GrayView_H_

#include <d3dx9.h>


struct VERTEXVIEW
{
	D3DXVECTOR4 Pos;
	DWORD		Color;
	D3DXVECTOR2 UV;
};

class GrayView
{
public:

	GrayView();
	~GrayView();

	bool Create( IDirect3DDevice9 *pkDevice, IDirect3DTexture9 *pkTexture );
	void SetSize( int Left, int Top, int Right, int Bottom, DWORD Color );

	void Update( unsigned int dt );
	void Render();
	void Release();


	void SetChagneTexture( IDirect3DTexture9 *pkTexture, bool Flag );
	void Begin();
	void End();

protected:

	void MakeBuffer();


	IDirect3DDevice9		*m_pkDevice;
	IDirect3DTexture9		*m_pkTexture;
	IDirect3DSurface9		*m_pkSurface;
	IDirect3DVertexBuffer9	*m_pkVB;

	ID3DXRenderToSurface	*m_pkRenderToSur;

	
	int	m_iTextureSize;
	VERTEXVIEW	m_kVertex[4];
	

	DWORD		m_dFVF;
	D3DXMATRIXA16	m_matworld;
	bool m_bFlag;

};

#endif // _GrayView_H_